﻿using System;
using System.ComponentModel;
using System.IO;
using System.Runtime.Serialization;

namespace HalconDotNet
{
	/// <summary>Represents an instance of an iconic object(-array). Base class for images, regions and XLDs</summary>
	// Token: 0x0200004F RID: 79
	[Serializable]
	public class HObject : HObjectBase, ISerializable, ICloneable
	{
		/// <summary>Create an uninitialized iconic object</summary>
		// Token: 0x06000AF3 RID: 2803 RVA: 0x00045740 File Offset: 0x00043940
		public HObject() : base(HObjectBase.UNDEF, false)
		{
		}

		// Token: 0x06000AF4 RID: 2804 RVA: 0x0004574E File Offset: 0x0004394E
		[EditorBrowsable(EditorBrowsableState.Never)]
		public HObject(IntPtr key) : this(key, true)
		{
			this.AssertObjectClass();
			GC.KeepAlive(this);
		}

		// Token: 0x06000AF5 RID: 2805 RVA: 0x00045764 File Offset: 0x00043964
		[EditorBrowsable(EditorBrowsableState.Never)]
		public HObject(IntPtr key, bool copy) : base(key, copy)
		{
			this.AssertObjectClass();
			GC.KeepAlive(this);
		}

		// Token: 0x06000AF6 RID: 2806 RVA: 0x0004577A File Offset: 0x0004397A
		[EditorBrowsable(EditorBrowsableState.Never)]
		public HObject(HObject obj) : base(obj)
		{
			this.AssertObjectClass();
			GC.KeepAlive(this);
		}

		// Token: 0x06000AF7 RID: 2807 RVA: 0x00020D0B File Offset: 0x0001EF0B
		private void AssertObjectClass()
		{
		}

		/// <summary>Returns the iconic object(s) at the specified index</summary>
		// Token: 0x1700004E RID: 78
		public HObject this[HTuple index]
		{
			get
			{
				return this.SelectObj(index);
			}
		}

		// Token: 0x06000AF9 RID: 2809 RVA: 0x00045798 File Offset: 0x00043998
		[EditorBrowsable(EditorBrowsableState.Never)]
		public static int LoadNew(IntPtr proc, int parIndex, int err, out HObject obj)
		{
			obj = new HObject(HObjectBase.UNDEF);
			return obj.Load(proc, parIndex, err);
		}

		// Token: 0x06000AFA RID: 2810 RVA: 0x000457B0 File Offset: 0x000439B0
		void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
		{
			HSerializedItem hserializedItem = this.SerializeObject();
			byte[] value = hserializedItem;
			hserializedItem.Dispose();
			info.AddValue("data", value, typeof(byte[]));
		}

		// Token: 0x06000AFB RID: 2811 RVA: 0x000457E8 File Offset: 0x000439E8
		[EditorBrowsable(EditorBrowsableState.Never)]
		public HObject(SerializationInfo info, StreamingContext context)
		{
			HSerializedItem hserializedItem = new HSerializedItem((byte[])info.GetValue("data", typeof(byte[])));
			this.DeserializeObject(hserializedItem);
			hserializedItem.Dispose();
		}

		/// <summary>Serialize object to binary stream in HALCON format</summary>
		// Token: 0x06000AFC RID: 2812 RVA: 0x00045828 File Offset: 0x00043A28
		public void Serialize(Stream stream)
		{
			HSerializedItem hserializedItem = this.SerializeObject();
			hserializedItem.Serialize(stream);
			hserializedItem.Dispose();
		}

		/// <summary>Deserialize object from binary stream in HALCON format</summary>
		// Token: 0x06000AFD RID: 2813 RVA: 0x0004583C File Offset: 0x00043A3C
		public static HObject Deserialize(Stream stream)
		{
			HObject hobject = new HObject();
			HSerializedItem hserializedItem = HSerializedItem.Deserialize(stream);
			hobject.DeserializeObject(hserializedItem);
			hserializedItem.Dispose();
			return hobject;
		}

		// Token: 0x06000AFE RID: 2814 RVA: 0x00045862 File Offset: 0x00043A62
		object ICloneable.Clone()
		{
			return this.Clone();
		}

		// Token: 0x06000AFF RID: 2815 RVA: 0x0004586C File Offset: 0x00043A6C
		public HObject Clone()
		{
			HSerializedItem hserializedItem = this.SerializeObject();
			HObject hobject = new HObject();
			hobject.DeserializeObject(hserializedItem);
			hserializedItem.Dispose();
			return hobject;
		}

		/// <summary>
		///   Calculate the difference of two object tuples.
		///   Instance represents: Object tuple 1.
		/// </summary>
		/// <param name="objectsSub">Object tuple 2.</param>
		/// <returns>Objects from Objects that are not part of ObjectsSub.</returns>
		// Token: 0x06000B00 RID: 2816 RVA: 0x00045894 File Offset: 0x00043A94
		public HObject ObjDiff(HObject objectsSub)
		{
			IntPtr proc = HalconAPI.PreCall(573);
			base.Store(proc, 1);
			HalconAPI.Store(proc, 2, objectsSub);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HObject result;
			num = HObject.LoadNew(proc, 1, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(objectsSub);
			return result;
		}

		/// <summary>
		///   Convert an "integer number" into an iconic object.
		///   Modified instance represents: Created objects.
		/// </summary>
		/// <param name="surrogateTuple">Tuple of object surrogates.</param>
		// Token: 0x06000B01 RID: 2817 RVA: 0x000458EC File Offset: 0x00043AEC
		public void IntegerToObj(HTuple surrogateTuple)
		{
			this.Dispose();
			IntPtr proc = HalconAPI.PreCall(581);
			HalconAPI.Store(proc, 0, surrogateTuple);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(surrogateTuple);
			num = base.Load(proc, 1, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Convert an "integer number" into an iconic object.
		///   Modified instance represents: Created objects.
		/// </summary>
		/// <param name="surrogateTuple">Tuple of object surrogates.</param>
		// Token: 0x06000B02 RID: 2818 RVA: 0x00045940 File Offset: 0x00043B40
		public void IntegerToObj(IntPtr surrogateTuple)
		{
			this.Dispose();
			IntPtr proc = HalconAPI.PreCall(581);
			HalconAPI.StoreIP(proc, 0, surrogateTuple);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			num = base.Load(proc, 1, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Convert an iconic object into an "integer number."
		///   Instance represents: Objects for which the surrogates are to be returned.
		/// </summary>
		/// <param name="index">Starting index of the surrogates to be returned. Default: 1</param>
		/// <param name="number">Number of surrogates to be returned. Default: -1</param>
		/// <returns>Tuple containing the surrogates.</returns>
		// Token: 0x06000B03 RID: 2819 RVA: 0x0004598C File Offset: 0x00043B8C
		public HTuple ObjToInteger(int index, int number)
		{
			IntPtr proc = HalconAPI.PreCall(582);
			base.Store(proc, 1);
			HalconAPI.StoreI(proc, 0, index);
			HalconAPI.StoreI(proc, 1, number);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HTuple result;
			num = HTuple.LoadNew(proc, 0, HTupleType.INTEGER, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Copy an iconic object in the HALCON database.
		///   Instance represents: Objects to be copied.
		/// </summary>
		/// <param name="index">Starting index of the objects to be copied. Default: 1</param>
		/// <param name="numObj">Number of objects to be copied or -1. Default: 1</param>
		/// <returns>Copied objects.</returns>
		// Token: 0x06000B04 RID: 2820 RVA: 0x000459E8 File Offset: 0x00043BE8
		public HObject CopyObj(int index, int numObj)
		{
			IntPtr proc = HalconAPI.PreCall(583);
			base.Store(proc, 1);
			HalconAPI.StoreI(proc, 0, index);
			HalconAPI.StoreI(proc, 1, numObj);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HObject result;
			num = HObject.LoadNew(proc, 1, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Concatenate two iconic object tuples.
		///   Instance represents: Object tuple 1.
		/// </summary>
		/// <param name="objects2">Object tuple 2.</param>
		/// <returns>Concatenated objects.</returns>
		// Token: 0x06000B05 RID: 2821 RVA: 0x00045A40 File Offset: 0x00043C40
		public HObject ConcatObj(HObject objects2)
		{
			IntPtr proc = HalconAPI.PreCall(584);
			base.Store(proc, 1);
			HalconAPI.Store(proc, 2, objects2);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HObject result;
			num = HObject.LoadNew(proc, 1, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(objects2);
			return result;
		}

		/// <summary>
		///   Select objects from an object tuple.
		///   Instance represents: Input objects.
		/// </summary>
		/// <param name="index">Indices of the objects to be selected. Default: 1</param>
		/// <returns>Selected objects.</returns>
		// Token: 0x06000B06 RID: 2822 RVA: 0x00045A98 File Offset: 0x00043C98
		public HObject SelectObj(HTuple index)
		{
			IntPtr proc = HalconAPI.PreCall(587);
			base.Store(proc, 1);
			HalconAPI.Store(proc, 0, index);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(index);
			HObject result;
			num = HObject.LoadNew(proc, 1, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Select objects from an object tuple.
		///   Instance represents: Input objects.
		/// </summary>
		/// <param name="index">Indices of the objects to be selected. Default: 1</param>
		/// <returns>Selected objects.</returns>
		// Token: 0x06000B07 RID: 2823 RVA: 0x00045AF0 File Offset: 0x00043CF0
		public HObject SelectObj(int index)
		{
			IntPtr proc = HalconAPI.PreCall(587);
			base.Store(proc, 1);
			HalconAPI.StoreI(proc, 0, index);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HObject result;
			num = HObject.LoadNew(proc, 1, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Compare iconic objects regarding equality.
		///   Instance represents: Reference objects.
		/// </summary>
		/// <param name="objects2">Test objects.</param>
		/// <param name="epsilon">Maximum allowed difference between two gray values or  coordinates etc. Default: 0.0</param>
		/// <returns>Boolean result value.</returns>
		// Token: 0x06000B08 RID: 2824 RVA: 0x00045B40 File Offset: 0x00043D40
		public int CompareObj(HObject objects2, HTuple epsilon)
		{
			IntPtr proc = HalconAPI.PreCall(588);
			base.Store(proc, 1);
			HalconAPI.Store(proc, 2, objects2);
			HalconAPI.Store(proc, 0, epsilon);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(epsilon);
			int result;
			num = HalconAPI.LoadI(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(objects2);
			return result;
		}

		/// <summary>
		///   Compare iconic objects regarding equality.
		///   Instance represents: Reference objects.
		/// </summary>
		/// <param name="objects2">Test objects.</param>
		/// <param name="epsilon">Maximum allowed difference between two gray values or  coordinates etc. Default: 0.0</param>
		/// <returns>Boolean result value.</returns>
		// Token: 0x06000B09 RID: 2825 RVA: 0x00045BA4 File Offset: 0x00043DA4
		public int CompareObj(HObject objects2, double epsilon)
		{
			IntPtr proc = HalconAPI.PreCall(588);
			base.Store(proc, 1);
			HalconAPI.Store(proc, 2, objects2);
			HalconAPI.StoreD(proc, 0, epsilon);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			int result;
			num = HalconAPI.LoadI(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(objects2);
			return result;
		}

		/// <summary>
		///   Compare image objects regarding equality.
		///   Instance represents: Test objects.
		/// </summary>
		/// <param name="objects2">Comparative objects.</param>
		/// <returns>boolean result value.</returns>
		// Token: 0x06000B0A RID: 2826 RVA: 0x00045C04 File Offset: 0x00043E04
		public int TestEqualObj(HObject objects2)
		{
			IntPtr proc = HalconAPI.PreCall(591);
			base.Store(proc, 1);
			HalconAPI.Store(proc, 2, objects2);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			int result;
			num = HalconAPI.LoadI(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(objects2);
			return result;
		}

		/// <summary>
		///   Number of objects in a tuple.
		///   Instance represents: Objects to be examined.
		/// </summary>
		/// <returns>Number of objects in the tuple Objects.</returns>
		// Token: 0x06000B0B RID: 2827 RVA: 0x00045C5C File Offset: 0x00043E5C
		public int CountObj()
		{
			IntPtr proc = HalconAPI.PreCall(592);
			base.Store(proc, 1);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			int result;
			num = HalconAPI.LoadI(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Informations about the components of an image object.
		///   Instance represents: Image object to be examined.
		/// </summary>
		/// <param name="request">Required information about object components. Default: "creator"</param>
		/// <param name="channel">Components to be examined (0 for region/XLD). Default: 0</param>
		/// <returns>Requested information.</returns>
		// Token: 0x06000B0C RID: 2828 RVA: 0x00045CA4 File Offset: 0x00043EA4
		public HTuple GetChannelInfo(string request, HTuple channel)
		{
			IntPtr proc = HalconAPI.PreCall(593);
			base.Store(proc, 1);
			HalconAPI.StoreS(proc, 0, request);
			HalconAPI.Store(proc, 1, channel);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(channel);
			HTuple result;
			num = HTuple.LoadNew(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Informations about the components of an image object.
		///   Instance represents: Image object to be examined.
		/// </summary>
		/// <param name="request">Required information about object components. Default: "creator"</param>
		/// <param name="channel">Components to be examined (0 for region/XLD). Default: 0</param>
		/// <returns>Requested information.</returns>
		// Token: 0x06000B0D RID: 2829 RVA: 0x00045D04 File Offset: 0x00043F04
		public string GetChannelInfo(string request, int channel)
		{
			IntPtr proc = HalconAPI.PreCall(593);
			base.Store(proc, 1);
			HalconAPI.StoreS(proc, 0, request);
			HalconAPI.StoreI(proc, 1, channel);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			string result;
			num = HalconAPI.LoadS(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Name of the class of an image object.
		///   Instance represents: Image objects to be examined.
		/// </summary>
		/// <returns>Name of class.</returns>
		// Token: 0x06000B0E RID: 2830 RVA: 0x00045D5C File Offset: 0x00043F5C
		public HTuple GetObjClass()
		{
			IntPtr proc = HalconAPI.PreCall(594);
			base.Store(proc, 1);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HTuple result;
			num = HTuple.LoadNew(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Create an empty object tuple.
		///   Modified instance represents: No objects.
		/// </summary>
		// Token: 0x06000B0F RID: 2831 RVA: 0x00045DA4 File Offset: 0x00043FA4
		public void GenEmptyObj()
		{
			this.Dispose();
			IntPtr proc = HalconAPI.PreCall(617);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			num = base.Load(proc, 1, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Displays image objects (image, region, XLD).
		///   Instance represents: Image object to be displayed.
		/// </summary>
		/// <param name="windowHandle">Window handle.</param>
		// Token: 0x06000B10 RID: 2832 RVA: 0x00045DE8 File Offset: 0x00043FE8
		public void DispObj(HWindow windowHandle)
		{
			IntPtr proc = HalconAPI.PreCall(1276);
			base.Store(proc, 1);
			HalconAPI.Store(proc, 0, windowHandle);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
			GC.KeepAlive(windowHandle);
		}

		/// <summary>
		///   Read an iconic object.
		///   Modified instance represents: Iconic object.
		/// </summary>
		/// <param name="fileName">Name of file.</param>
		// Token: 0x06000B11 RID: 2833 RVA: 0x00045E2C File Offset: 0x0004402C
		public void ReadObject(string fileName)
		{
			this.Dispose();
			IntPtr proc = HalconAPI.PreCall(1646);
			HalconAPI.StoreS(proc, 0, fileName);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			num = base.Load(proc, 1, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Write an iconic object.
		///   Instance represents: Iconic object.
		/// </summary>
		/// <param name="fileName">Name of file.</param>
		// Token: 0x06000B12 RID: 2834 RVA: 0x00045E78 File Offset: 0x00044078
		public void WriteObject(string fileName)
		{
			IntPtr proc = HalconAPI.PreCall(1647);
			base.Store(proc, 1);
			HalconAPI.StoreS(proc, 0, fileName);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Deserialize a serialized iconic object.
		///   Modified instance represents: Iconic object.
		/// </summary>
		/// <param name="serializedItemHandle">Handle of the serialized item.</param>
		// Token: 0x06000B13 RID: 2835 RVA: 0x00045EB4 File Offset: 0x000440B4
		public void DeserializeObject(HSerializedItem serializedItemHandle)
		{
			this.Dispose();
			IntPtr proc = HalconAPI.PreCall(1648);
			HalconAPI.Store(proc, 0, serializedItemHandle);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			num = base.Load(proc, 1, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(serializedItemHandle);
		}

		/// <summary>
		///   Serialize an iconic object.
		///   Instance represents: Iconic object.
		/// </summary>
		/// <returns>Handle of the serialized item.</returns>
		// Token: 0x06000B14 RID: 2836 RVA: 0x00045F08 File Offset: 0x00044108
		public HSerializedItem SerializeObject()
		{
			IntPtr proc = HalconAPI.PreCall(1649);
			base.Store(proc, 1);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HSerializedItem result;
			num = HSerializedItem.LoadNew(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Insert objects into an iconic object tuple.
		///   Instance represents: Input object tuple.
		/// </summary>
		/// <param name="objectsInsert">Object tuple to insert.</param>
		/// <param name="index">Index to insert objects.</param>
		/// <returns>Extended object tuple.</returns>
		// Token: 0x06000B15 RID: 2837 RVA: 0x00045F50 File Offset: 0x00044150
		public HObject InsertObj(HObject objectsInsert, int index)
		{
			IntPtr proc = HalconAPI.PreCall(2121);
			base.Store(proc, 1);
			HalconAPI.Store(proc, 2, objectsInsert);
			HalconAPI.StoreI(proc, 0, index);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HObject result;
			num = HObject.LoadNew(proc, 1, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(objectsInsert);
			return result;
		}

		/// <summary>
		///   Remove objects from an iconic object tuple.
		///   Instance represents: Input object tuple.
		/// </summary>
		/// <param name="index">Indices of the objects to be removed.</param>
		/// <returns>Remaining object tuple.</returns>
		// Token: 0x06000B16 RID: 2838 RVA: 0x00045FB0 File Offset: 0x000441B0
		public HObject RemoveObj(HTuple index)
		{
			IntPtr proc = HalconAPI.PreCall(2124);
			base.Store(proc, 1);
			HalconAPI.Store(proc, 0, index);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(index);
			HObject result;
			num = HObject.LoadNew(proc, 1, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Remove objects from an iconic object tuple.
		///   Instance represents: Input object tuple.
		/// </summary>
		/// <param name="index">Indices of the objects to be removed.</param>
		/// <returns>Remaining object tuple.</returns>
		// Token: 0x06000B17 RID: 2839 RVA: 0x00046008 File Offset: 0x00044208
		public HObject RemoveObj(int index)
		{
			IntPtr proc = HalconAPI.PreCall(2124);
			base.Store(proc, 1);
			HalconAPI.StoreI(proc, 0, index);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HObject result;
			num = HObject.LoadNew(proc, 1, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Replaces one or more elements of an iconic object tuple.
		///   Instance represents: Iconic Input Object.
		/// </summary>
		/// <param name="objectsReplace">Element(s) to replace.</param>
		/// <param name="index">Index/Indices of elements to be replaced.</param>
		/// <returns>Tuple with replaced elements.</returns>
		// Token: 0x06000B18 RID: 2840 RVA: 0x00046058 File Offset: 0x00044258
		public HObject ReplaceObj(HObject objectsReplace, HTuple index)
		{
			IntPtr proc = HalconAPI.PreCall(2125);
			base.Store(proc, 1);
			HalconAPI.Store(proc, 2, objectsReplace);
			HalconAPI.Store(proc, 0, index);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(index);
			HObject result;
			num = HObject.LoadNew(proc, 1, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(objectsReplace);
			return result;
		}

		/// <summary>
		///   Replaces one or more elements of an iconic object tuple.
		///   Instance represents: Iconic Input Object.
		/// </summary>
		/// <param name="objectsReplace">Element(s) to replace.</param>
		/// <param name="index">Index/Indices of elements to be replaced.</param>
		/// <returns>Tuple with replaced elements.</returns>
		// Token: 0x06000B19 RID: 2841 RVA: 0x000460BC File Offset: 0x000442BC
		public HObject ReplaceObj(HObject objectsReplace, int index)
		{
			IntPtr proc = HalconAPI.PreCall(2125);
			base.Store(proc, 1);
			HalconAPI.Store(proc, 2, objectsReplace);
			HalconAPI.StoreI(proc, 0, index);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HObject result;
			num = HObject.LoadNew(proc, 1, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(objectsReplace);
			return result;
		}
	}
}
